<template>
	<view :class="['goods-price',size]">
		<text class="price u-font-bold u-type-error">
			<text class="price-left">￥</text>
			<text class="price-right">{{parseFloat(price)}}</text>
		</text>
		<text v-if="taxPrice && (parseFloat(taxPrice) > parseFloat(price))" class="taxPrice u-tips-color u-m-l-8">
			<text class="taxPrice-left">￥</text>
			<text class="taxPrice-right">{{parseFloat(taxPrice)}}</text>
		</text>
	</view>
</template>

<script>
	export default{
		props:{
			// 售价
			price:{
				type:[String,Number]
			},
			// 原价
			taxPrice:{
				type:[String,Number]
			},
			// 型号(middle 中号；large: 大号)
			size:{
				type:String,
				default:'middle'
			}
		},
		mounted() {
			console.log()
		}
	}
</script>

<style lang="scss" scoped>
	.goods-price{
		display: inline-block;
	}
	.middle{
		.price{
			.price-left{
				font-size: 24rpx;
			}
			.price-right{
				font-size: 30rpx;
			}
		}
		.taxPrice{
			text-decoration: line-through;
			font-size: 24rpx;
		}
	}
	.large{
		.price{
			.price-left{
				font-size: 32rpx;
			}
			.price-right{
				font-size: 40rpx;
			}
		}
		.taxPrice{
			text-decoration: line-through;
			font-size: 24rpx;
		}
	}
</style>
